<{include file="public/header.html"}>
<script type="text/javascript" src="<{$smarty.const.STATIC_COMPONENT_URL}>js/common.js"></script>
<script type="text/javascript">
function validate()
{
    if (validateEmail())
	{
		document.choose_garage.submit();
	}
	return false;
}

function validateEmail()
{
	var form = document.choose_garage;
	var fullname = form.fullname;		
	var email = form.email;
	var phone = form.phone;
	var address = form.address;
	
	email.value = trim(email.value);
	fullname.value = trim(fullname.value);
	
	if (fullname.value == '')
	{
		alert('<{#_LB_VALIDATE_FULLNAME#|utf8_escape_js}>');
		fullname.focus();
		return false;
	}
	
	if(address.value == ''){
		alert('<{#_LB_VALIDATE_ADDRESS_EMPTY#|utf8_escape_js}>');
		address.focus();
		return false;
	}
	
	if (email.value == '')
	{
		alert('<{#_LB_VALIDATE_EMAIL#|utf8_escape_js}>');
        email.focus();
		return false;
	}
	
	if(isNaN(phone.value)){
		alert('<{#_LB_VALIDATE_NUMBER#|utf8_escape_js}>');
		phone.focus();
		return false;
	}
	
	if (!emailCheck(email.value))
	{
		alert('<{#_LB_FORMAT_EMAIL#|utf8_escape_js}>');
        email.focus();
		return false;
	}
    
	return true;
}
</script>
<div class="container">
    	<div class="signup">
            <div class="signup-title"><span>Choose garage</span></div>
            <div class="step3">
            	<form action="" method="post" name="choose_garage">
            		<input type="hidden" value="1" name="act" />
            		<input type="hidden" value="<{$garage->id}>" name="garage_id" />
            		<div class="row">
                    	<label>Garage : </label><{$garage->title}><br/>
                    </div>
            		<div class="row">
                    	<label>Fullname</label><input type="text" name="fullname" size="40" />
                    </div>
                    <div class="row">
                    	<label>Email</label><input type="text" name="email" size="40" />
                    </div>
                    <div class="row">
                    	<label>Phone number</label><input type="text" name="phone" size="40" />
                    </div>
                    <div class="row">
                    	<label>Address</label><input type="text" name="address" size="40" />
                    </div>
                    <div class="row">
                    	<label>Description</label><textarea rows="10" cols="50" name="desc" ></textarea>
                    </div>
                    <div class="row" style="margin: 10px 0 0 300px">
                    	<a onclick="validate();" class="button" ><img src="<{$smarty.const.STATIC_COMPONENT_URL}>images/btnContinue.jpg" class="btnContinue" style="float: left" /></a>
                		<a href="<{$smarty.const.APPLICATION_URL}>"><img src="<{$smarty.const.STATIC_COMPONENT_URL}>images/btnCancel.jpg" /></a>
                    </div>
            	</form>
            </div>
        </div>
    </div><!--end container-->
    <div class="clear"></div>
<{include file="public/footer.html"}>